import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from "path"

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    port: 5173,
    proxy: {
      "/admin": {
        target: "http://127.0.0.1:8123",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/admin/, "/admin"),
      },
    }
  },
  resolve: {
    alias: [
      {
        find: '@',
        replacement: resolve(__dirname, 'src'),
      },
      {
        find: 'vue-i18n', 
        replacement: 'vue-i18n/dist/vue-i18n.cjs.js'},
    ]
  },
})
